package demo1;

//牛客网: 素数回文

import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        int n = s.length();
        StringBuffer str = new StringBuffer(s);
        int i = n-2;
        while(i>=0) {
            str.append(s.charAt(i--));
        }
        long t = Long.valueOf(str.toString());
        if(isPrime(t)) {
            System.out.println("prime");
        }else {
            System.out.println("noprime");
        }
    }
    public static boolean isPrime(long n) {
        long k = (long)Math.sqrt(n);
        for(int i = 2; i<=k; i++) {
            if(n % i == 0) {
                return false;
            }
        }
        return true;
    }
}